﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace PNut_Project_Lin
{
    public partial class RepairPagexaml : PhoneApplicationPage
    {
        List<checkCar> listrepair = new List<checkCar>();

        public RepairPagexaml()
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(RepairPagexaml_Loaded);
        }

        void RepairPagexaml_Loaded(object sender, RoutedEventArgs e)
        {
           // throw new NotImplementedException();
            listrepair.Add(new checkCar("เปลี่ยนล้อรถยนต์", "", "picture/modp_0912_04_o+1994_mazda_miata_r_package+wheel_change.jpg", "http://www.mickku.com/battery.mp4"));
            listrepair.Add(new checkCar("พ่วงแบตเตอรี่", "", "picture/jump_battery_03.JPEG", "http://www.mickku.com/battery.mp4"));
            listrepair.Add(new checkCar("เติมน้ำหม้อน้ำ", "", "picture/9.JPG", "http://www.mickku.com/battery.mp4"));
            listrepair.Add(new checkCar("เปลี่ยนแบตเตอรี่", "", "picture/car_battery_change.jpg", "http://www.mickku.com/battery.mp4"));
            listrepair.Add(new checkCar("เปลี่ยนน้ำมันเครื่อง", "", "picture/DSCF1362copy.jpg", "http://www.mickku.com/battery.mp4"));

            RepairListBox.ItemsSource = listrepair;
        }

        private void RepairListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/DetailPage.xaml?Name=" + listrepair.ElementAt(RepairListBox.SelectedIndex).Name + "&Detail=" + listrepair.ElementAt(RepairListBox.SelectedIndex).Detail + "&img=" + listrepair.ElementAt(RepairListBox.SelectedIndex).img + "&Link=" + listrepair.ElementAt(RepairListBox.SelectedIndex).Link, UriKind.Relative));
      
        }
    }
}